<!--课程考核成绩-->
<template>
  <div class="wrapper-container">
    <div
      class="search-container"
      style="justify-content: flex-start !important"
    >
      <div class="filter-button" style="margin-top:0">
        <el-radio-group v-model="radio4" size="mini" @change="chooseType">
          <el-radio-button label="">全部</el-radio-button>
          <el-radio-button style="padding: 0 10px" label="选修"
            >选修</el-radio-button
          >
          <el-radio-button label="必修">必修</el-radio-button>
        </el-radio-group>
      </div>
    </div>
    <div class="table-container">
      <div
        style="border: 1px solid rgba(0, 76, 167, 0.39)"
        v-for="(item, index) in tableData"
        :key="index"
        class=""
      >
        <el-form ref="form" class="my-form">
          <el-row class="item-row">
            <el-col class="name-col" :span="24"> {{ item.xuenian }} </el-col>
          </el-row>
          <el-row>
            <el-col
              :span="24"
              style="
                display: flex;
                justify-content: end;
                padding: 10px 20px;
                margin-bottom: 20px;
                color: #004ca7;
                border-bottom: 1px solid rgba(0, 76, 167, 0.39);
              "
            >
              <span>学年评定成绩(课终考核部分) 得分：{{ item.score }}</span>
            </el-col>
          </el-row>
        </el-form>
        <div
          style="padding: 10px 20px"
          v-for="(data, index2) in item.list"
          :key="index2 + 100"
        >
          <el-row class="item-row2 item-row">
            <el-col class="name-col" :span="24"> {{ data.termid }} </el-col>
          </el-row>
          <el-table
            max-height="335"
            :data="item.list"
            border
            style="width: 100%"
            class="table-data"
            row-class-name="row-class"
            cell-class-name="cell-class"
            header-row-class-name="header-row-class"
            header-cell-class-name="header-cell-class"
          >
            <el-table-column prop="serialNumber" label="序号" align="center">
            </el-table-column>
            <el-table-column prop="coursename" label="课程名称" align="center">
            </el-table-column>
            <el-table-column prop="classhour" label="学时" align="center">
            </el-table-column>
            <el-table-column prop="coursetype" label="修习类型" align="center">
            </el-table-column>
            <!-- <el-table-column
              width="180"
              v-for="item in itemType"
              :key="item.toString()"
              :prop="item"
              align="center"
            >
              <template slot="header">
                {{ itemTypeObject[item] }}成绩(比例)
              </template>
              <template slot-scope="scope">
                <span>{{ scope.row[item] }}</span>
              </template>
            </el-table-column> -->
            <el-table-column prop="usualscorerate"  width="180" label="课下作业成绩(比例)" align="center">
            </el-table-column>
            <el-table-column prop="examscorerate"  width="180" label="课堂测评成绩(比例)" align="center">
            </el-table-column>
            <el-table-column prop="midtermscorerate"  width="180" label="期中考试成绩(比例)" align="center">
            </el-table-column>
            <el-table-column prop="experimentscorerate"  width="180" label="课终考核成绩(比例)" align="center">
            </el-table-column>
            <el-table-column prop="scorenumber"  width="180" label="总评成绩" align="center">
            </el-table-column>
            <el-table-column prop="bkscore" label="补考成绩" align="center">
            </el-table-column>
            <el-table-column prop="credithour" label="学分" align="center">
            </el-table-column>
            <el-table-column prop="comments" label="备注" align="center">
            </el-table-column>
          </el-table>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import SelectItem from "../../../components/SelectItem.vue";
import InputItem from "../../../components/InputItem.vue";
import ButtonItem from "../../../components/ButtonItem.vue";
import Subscript from "../../../components/Subscript.vue";
import { kckhdate } from "@/api/student/student";
export default {
  components: {
    SelectItem,
    InputItem,
    ButtonItem,
    Subscript,
  },
  data() {
    return {
      itemType: ["value1", "value2", "value3", "value4"],
      itemTypeObject: {
        value1: "课下作业",
        value2: "课堂测评",
        value3: "期中考试",
        value4: "课终考核",
      },
      radio4: "全部",
      // tableData: [],
      tableData: [],
      multipleSelection: [],
    };
  },
  created() {
    this.kckhdate();
  },
  methods: {
    chooseType(val){
      this.radio4 = val;
      this.kckhdate();
    },
    kckhdate() {
      return new Promise(() => {
        kckhdate(this.radio4).then((res) => {
          this.tableData = res.data.data;
        });
      });
    },
  },
  computed: {},
};
</script>
<style lang="less" scoped>
.search-container {
  justify-content: flex-start !important;
}

.search-button {
  cursor: pointer;
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 27px;
  background: #f1f8fe;
  border: 1px solid #51aef6;
  border-radius: 6px;

  > span {
    font-size: 14px;
    font-family: Microsoft YaHei;
    font-weight: 400;
    color: #51aef6;
  }

  > img {
    width: 19px;
    height: 19px;
    margin-right: 4px;
  }
}

.table-container {
  margin-top: 30px;
  .el-table td,
  .el-table th.is-leaf,
  .el-table--border,
  .el-table--group {
    border-color: #c7d7eb;
  }

  .el-table__header tr,
  .el-table__header th {
    padding: 0;
    height: 76px;
    background-color: #edf2f9;
    font-size: 16px;
    font-family: Microsoft YaHei;
    font-weight: bold;
    line-height: 20px;
    color: #004ca7;
  }

  .el-table__body tr,
  .el-table__body td {
    padding: 0;
    height: 86px;
  }

  .wrapper-button {
    display: flex;
    flex-direction: column;
    align-items: center;

    > div {
      margin-bottom: 8px;
    }
  }
}
</style>

<style lang="less" scoped>
.table-container::v-deep .el-table .el-table__cell {
  background-color: white !important;
}
@import "../../../styles/special.less";

.item-row .el-col {
  display: flex;
  align-items: center;
  min-height: 60px;
  border-right: none !important;
}
.item-row2 .el-col {
  min-height: 40px;
}
.item-row2 {
  border: 1px solid #c7d7eb;
}

.item-row .el-col:not(:first-child) {
  border-left: 1px solid rgba(0, 76, 167, 0.39);
}
.single-row .el-col:not(:last-child) {
  border-right: 1px solid rgba(0, 76, 167, 0.39);
}
.my-form .single-row:not(:last-child) {
  border-bottom: 1px solid rgba(0, 76, 167, 0.39);
}
.item-row2 .name-col {
  background: rgba(77, 129, 192, 0.1) !important;
}
.name-col {
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
  color: #004ca7;
  background: rgb(200, 216, 235);
}
.content-col {
  padding-left: 10%;
}
.filter-button::v-deep .el-radio-button .el-radio-button__inner {
  border-radius: 6px !important;
  border: 1px solid #02c86c;
  color: #02c86c;
  background-color: #dfffef;
}
.filter-button::v-deep
  .el-radio-button__orig-radio:checked
  + .el-radio-button__inner {
  border: 1px solid #02c86c;
  color: white;
  background-color: #02c86c;
}
.bottom-block {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  .text {
    font-size: 14px;
    font-family: Microsoft YaHei;
    font-weight: 400;
    line-height: 39px;
    color: #004ca7;
  }
}
.table-container ::v-deep .el-table--border .el-table__cell:first-child .cell {
  padding-left: 10px !important;
}
.filter-button1::v-deep .el-radio-button .el-radio-button__inner {
  border-radius: 6px !important;
  border: 1px solid rgb(245, 134, 106);
  color: rgb(245, 134, 106);
  background-color: rgb(254, 237, 226);
}
.filter-button1::v-deep
  .el-radio-button__orig-radio:checked
  + .el-radio-button__inner {
  border: 1px solid rgb(245, 134, 106);
  color: white;
  background-color: rgb(245, 134, 106);
}
.filter-button {
  display: flex;
  margin-top: 27px;
}
.wrapper-container {
  width: 1711px;
  margin: 0 auto;
}
.table-container {
  margin-top: 30px;

  .table-data {
    width: 100%;
    border: 0.8px solid #c7d7eb;
    // border-radius: 9px;
    font-size: 14px;
    font-family: Microsoft YaHei;
    font-weight: 400;
    color: #004ca7;
  }
}
.save-button {
  width: 87px;
  height: 36px;
  line-height: 36px;
  background: #fff6ef;
  border: 1px solid #f3b815;
  border-radius: 6px;
  font-size: 18px;
  font-family: Microsoft YaHei;
  font-weight: 400;
  color: #f3b815;
  text-align: center;
  margin: 82px auto;
}

.zuoyou {
  width: 200px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}
</style>
